package com.itheima;

import java.util.Scanner;

public class Ride2 {
    public static void main(String[] args) {
        System.out.println("输入你要计算的数字");
        Scanner sc =new Scanner(System.in);
        int num = sc.nextInt();
        int result = RideTool(num);
        System.out.println(result);
    }

    public static int RideTool(int num){
        if(num==1){
            return 1;
        }else {
            return num * RideTool(num-1);
        }
    }
}
